package com.markul.android.logic.room


import androidx.room.*
import com.baidu.mapapi.model.LatLng

@Entity
data class User(
    var phone: String,
    var possword: String,
    var headImage: String,
//    val friendsIdList:ArrayList<Int>,
//    val badgeIdList:ArrayList<String>,
//    var privateAlbumList:ArrayList<Album>,
){
    @PrimaryKey(autoGenerate = true)
    var userId: Int=0
}

//个人数据库
@Entity
data class Album(
    var albumOwnerId:Int,
    var albumText:String?,
    var lat:Double,
    var lng:Double,
    var albumTime:String,
    var albumIcon1:Int?,
    var albumIcon2:Int?,
    var albumIcon3:Int?
){
    @PrimaryKey(autoGenerate = true)
    var albumId: Int=0
}

@Entity
data class Photo(
    var photoUrl:String,
    var photoOwnerId:Int
){
    @PrimaryKey(autoGenerate = true)
    var photoId: Int = 0
}

//data class OwnerWithAlbums(
//    @Embedded val user: User,
//    @Relation(
//        parentColumn = "userId",
//        entityColumn = "albumOwnerId"
//    )
//    val albumList: List<Album>
//)

data class AlbumWithPhotos(
    @Embedded val album:Album,
    @Relation(
        parentColumn = "albumId",
        entityColumn = "photoOwnerId"
    )
    val photoList: List<Photo>
)

data class AlbumInfo(val lat:Double,val lng: Double, val time:String?)

